<?php

function get_arr_staff_in_list($p_id_list){
	$i = 0;
	foreach($_SESSION['arr_all_enduser'] as $v_staff){
		if (_list_have_element($p_id_list,$v_staff['id'],',')==true){
			$arr_child_staff[$i][0] = $v_staff['id'];
			$arr_child_staff[$i][1] = $v_staff['unit_id'];
			$arr_child_staff[$i][2] = $v_staff['code'];
			$arr_child_staff[$i][3] = $v_staff['name'];
			$arr_child_staff[$i][4] = 1;
			$arr_child_staff[$i][5] = 1;
			$i++;
		}
	}
	return $arr_child_staff;
}
function xslt() { 
      $this->processor = xslt_create(); 
   } 
function Generate_handler_List($arr_list,$IdColumn,$NameColumn,$Valuelist,$GroupCheckboxName,$v_tr_name,$v_radio_name) {
	$arr_value = explode(",", $Valuelist);
	$v_count_item = sizeof($arr_list);
	$v_count_value = sizeof($arr_value);
	//$v_tr_name = '"tr_item"';
	//$v_radio_name = '"rad_item_manager"';
	$strHTML='';
	if ($v_count_item > 0){
	$strHTML =$strHTML. '<DIV STYLE="overflow: auto; height:75pt;padding-left:5px;margin:0px">';
	$strHTML = $strHTML . "<table class='list_table2'  width='100%' cellpadding='0' cellspacing='0'><col width='2%'><col width='98%'>";
	
		$i=0;
		$v_item_url_onclick = "change_item_checked(this,$v_tr_name,$v_radio_name)";
		while ($i<$v_count_item) {
			$v_item_id = $arr_list[$i][$IdColumn];
			$v_item_name = $arr_list[$i][$NameColumn]; 
			if ($v_current_style_name == "odd_row"){
				$v_current_style_name = "round_row";
			}else{
				$v_current_style_name = "odd_row";
			}
			$v_item_checked = "";
			for ($j=0; $j<$v_count_value; $j++)
			if ($arr_value[$j]==$v_item_id){
				$v_item_checked = "checked";
				break;
			}
			$strHTML = $strHTML . "<tr id=$v_tr_name  value='$v_item_id' checked='$v_item_checked' class='$v_current_style_name'>";
			$strHTML = $strHTML . "<td><input type='checkbox' name= "."'".$GroupCheckboxName."'"." value='$v_item_id' $v_item_checked  onClick='$v_item_url_onclick' onKeyDown='change_focus(document.forms(0),this)'></td>";
			$strHTML = $strHTML . "<td style='width:100%'>$v_item_name</td></tr>";
			$i++;
		}
	
	$strHTML = $strHTML ."</table>";
	$strHTML = $strHTML . "</DIV>";
	
	$strHTML = $strHTML . "<table width='100%' cellpadding='0' cellspacing='0'><col width='2%'><col width='98%'>";
	$strHTML = $strHTML . "<tr><td class='small_radiobutton' colspan='10' align='right'>";
	$strHTML = $strHTML . "<input type='radio' id=$v_radio_name value='1' checked onClick='show_row_all($v_radio_name,$v_tr_name);re_display_list_handler();' onKeyDown='change_focus(document.forms(0),this)'>Hi&#7875;n th&#7883; t&#7845;t c&#7843;";
	$strHTML = $strHTML . "<input type='radio' id=$v_radio_name value='2' onClick='show_row_selected($v_radio_name,$v_tr_name);' onKeyDown='change_focus(document.forms(0),this)'>Ch&#7881; hi&#7875;n th&#7883; c&#225;c &#273;&#7889;i t&#432;&#7907;ng &#273;&#432;&#7907;c ch&#7885;n";
	$strHTML = $strHTML . "</td></tr>";
	$strHTML = $strHTML ."</table>";
	}
	else $strHTML = "(Không có cán bộ nào thuộc phòng này.)";
	return $strHTML;
}

?>
